﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PrimaryStudentPainProgram
{
    public partial class ResultForm : Form
    {
        ParentForm parentForm;
        public ResultForm(ParentForm parentForm)
        {
            InitializeComponent();
            this.parentForm = parentForm;
            this.WindowState = FormWindowState.Maximized;
        }

        public void update()
        {
            string result = "";
            foreach (FixPair pair in parentForm.wrongList)
            {
                if (pair.timeout)
                    result += pair.puzzle + "  超时;  正确答案:" + pair.answer + "\r\n\r\n";
                else
                    result += pair.puzzle + "  错误答案:" + pair.input + "  正确答案:" + pair.answer + "\r\n\r\n";
            }
            this.textBoxResult.Text = result;
        }

        private void buttonReturn_Click(object sender, EventArgs e)
        {
            parentForm.restart();
        }
    }
}
